home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / GLUT-3.7 / LIB / GLE / GUTIL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-12  |  2.6 KB  |  90 lines

  1.  
  2. /*
  3.  * gutil.h
  4.  *
  5.  * FUNCTION:
  6.  * Provide utilities that allow rotation to occur 
  7.  * around any axis.
  8.  * 
  9.  * HISTORY:
  10.  * created by Linas Vepstas  1990
  11.  * added single & double precision, June 1991, Linas Vepstas
  12.  */
  13.  
  14. #ifndef __GUTIL_H__
  15. #define __GUTIL_H__
  16.  
  17. #ifdef __GUTIL_DOUBLE
  18. #define gutDouble double
  19. #else
  20. #define gutDouble float  
  21. #endif
  22.  
  23.  
  24. #ifdef _NO_PROTO        /* NO ANSI C PROTOTYPING */
  25.  
  26. /* Rotation Utilities */
  27. extern void rot_axis_f ();
  28. extern void rot_about_axis_f ();
  29. extern void rot_omega_f ();
  30. extern void urot_axis_f ();
  31. extern void urot_about_axis_f ();
  32. extern void urot_omega_f ();
  33.  
  34. /* double-precision versions */
  35. extern void rot_axis_d ();
  36. extern void rot_about_axis_d ();
  37. extern void rot_omega_d ();
  38. extern void urot_axis_d ();
  39. extern void urot_about_axis_d ();
  40. extern void urot_omega_d ();
  41.  
  42. /* viewpoint functions */
  43. extern void uview_direction_d ();
  44. extern void uview_direction_f ();
  45. extern void uviewpoint_d ();
  46. extern void uviewpoint_f ();
  47.  
  48. #else /* _NO_PROTO */        /* ANSI C PROTOTYPING */
  49.  
  50. /* Rotation Utilities */
  51. extern void rot_axis_f (float omega, float axis[3]);
  52. extern void rot_about_axis_f (float angle, float axis[3]);
  53. extern void rot_omega_f (float axis[3]);
  54. extern void urot_axis_f (float m[4][4], float omega, float axis[3]);
  55. extern void urot_about_axis_f (float m[4][4], float angle, float axis[3]);
  56. extern void urot_omega_f (float m[4][4], float axis[3]);
  57.  
  58. /* double-precision versions */
  59. extern void rot_axis_d (double omega, double axis[3]);
  60. extern void rot_about_axis_d (double angle, double axis[3]);
  61. extern void rot_omega_d (double axis[3]);
  62. extern void urot_axis_d (double m[4][4], double omega, double axis[3]);
  63. extern void urot_about_axis_d (double m[4][4], double angle, double axis[3]);
  64. extern void urot_omega_d (double m[4][4], double axis[3]);
  65.  
  66. /* viewpoint functions */
  67. extern void uview_direction_d (double m[4][4],        /* returned */
  68.                         double v21[3],        /* input */
  69.                         double up[3]);        /* input */
  70.  
  71. extern void uview_direction_f (float m[4][4],        /* returned */
  72.                         float v21[3],        /* input */
  73.                         float up[3]);        /* input */
  74.  
  75. extern void uviewpoint_d (double m[4][4],        /* returned */
  76.                    double v1[3],        /* input */
  77.                    double v2[3],        /* input */
  78.                    double up[3]);        /* input */
  79.  
  80. extern void uviewpoint_f (float m[4][4],        /* returned */
  81.                    float v1[3],        /* input */
  82.                    float v2[3],        /* input */
  83.                    float up[3]);        /* input */
  84.  
  85. #endif /* _NO_PROTO */
  86.  
  87. #endif /* _GUTIL_H__ */
  88.  
  89. /* ------------------- end of file ---------------------- */
  90.